#include <iostream>

//https://www.nowcoder.com/practice/1277c681251b4372bdef344468e4f26e?tpId=13&&tqId=11202&rp=6&ru=/activity/oj&qru=/ta/coding-interviews/question-ranking

using namespace std;

class Solution {
public:
    int StrToInt(string str) {
        int i = 0;
        int flag = 1;
        int ret = 0;
        if (str[i] == '+') {
            ++i;
        } else if (str[i] == '-') {
            flag = -1;
            ++i;
        }
        while (str[i]) {
            if ('0' > str[i] || str[i] > '9') {
                return 0;
            }
            ret *= 10;
            ret += str[i] - '0';
            ++i;
        }
        return ret * flag;
    }
};

int main() {

    return 0;
}


